﻿//-----------------------------------------------------------------------
// <copyright company="Microsoft Corporation">
//     Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Microsoft.DevDiv.Wpf.Samples
{
    using System;

    public class LiveSearchImageResult
    {
        public Uri MediaUrl
        {
            get
            {
                return this.mediaUrl =
                    this.mediaUrl ?? this.inner.GetValueAsUrl("./mms:MediaUrl");
            }
        }

        public LiveSearchImageThumbnail Thumbnail
        {
            get
            {
                return this.thumbnail =
                this.thumbnail ?? this.inner.GetObject<LiveSearchImageThumbnail>("./mms:Thumbnail", LiveSearchImageThumbnail.Create);
            }
        }

        internal static LiveSearchImageResult Create(LiveSearchXmlObject inner)
        {
            return new LiveSearchImageResult()
            {
                inner = inner
            };
        }

        private Uri mediaUrl;
        private LiveSearchImageThumbnail thumbnail;
        private LiveSearchXmlObject inner;
    }
}